home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DTS_SCSI_Debug.h
-
-
-
-
- Unfortunately, no matter how long awaited, it's still not done. In fact, this
- isn't even a release- this is just an image of the code taken in the middle of
- development.
-
- THIS CODE DOES NOT WORK AS A WHOLE. MUCH OF IT IS BUGGY AND / OR INCOMPLETE.
- YOU WOULD HAVE TO BE ABSOLUTELY INSANE TO USE ANY OF THIS CODE IN YOUR
- PROJECT WITHOUT EXTENSIVE THOUGHT, DEBUGGING AND TESTING.
-
-
-
-
-
- Contains: debugging support
-
- Written by: Craig Prouse
-
- Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 03/10/92 BJS Add comments to Prouse's original version; check in to new project
-
- To Do:
- */
-
- /*
- * These macros allow addition of debug-only invariant tests. In a debug build,
- * we can test for a condition that we know should never happen in real life,
- * without having a lot of special-case text; through the use of this "assert"
- * macro, the test will automatically be excluded from production code. This is
- * similar to the mechanism used by the MPW-supplied "assert.h" macros.
- */
- #ifndef DEBUG
- #define assert(condition,debugMsg) ((void) 0)
- #define assertv(condition,debugMsg) ((void) 0)
- #else
- // #define assert(condition,debugMsg) ((condition) ? (void) 0 : debugstr(debugMsg))
-
- // *** comment this
- #pragma parameter CritErr(__D0, __D1)
- void CritErr(int top, int bottom) = { 0x2C00, 0x2E01, 0x2078, 0x02AE, 0x4EE8, 0x0026 };
- // 00000000: 2C01 ',.' MOVE.L D0,D7
- // 00000002: 2E00 '..' MOVE.L D1,D6
- // 00000004: 2078 02AE ' x..' MOVEA.L ROMBase,A0
- // 00000008: 4EE8 0026 'N..&' JMP $0026(A0)
-
- // ****** YECCCH
- #define assert(condition,debugMsg) \
- if (!(condition)) \
- if (*(long*)0x120) \
- debugstr(debugMsg); \
- else \
- CritErr(__FILE_NUMBER__ | __LINE__, 0xDeadFace) //*** Comment why done this way.
-
- #define assertv(condition,debugVal) \
- if (!(condition)) \
- if (*(long*)0x120) \
- Debugger(); \
- else \
- CritErr(__FILE_NUMBER__ | __LINE__, debugVal)
- #endif
-
-